     let num = $("#num");
     let size = "";
     let strUrl = location.href;
     let id = strUrl.slice(strUrl.indexOf("=") + 1);
     $(
         function() {

             let data = null;

             let margin = 0;
             $.ajax({
                 url: "/product/queryProductDetail",
                 async: false,
                 type: "get",
                 data: {
                     id: id
                 },
                 success: function(res) {
                     data = res;
                     console.log(data);
                     console.log(data.size.split('-'));
                     let html = template("detailTpl", data);
                     $("#detailInfo").html(html);
                     let gallery = mui('.mui-slider');
                     gallery.slider();
                 }
             });

             $("#detailInfo").on("tap", ".size span ", function() {
                 $(this).addClass("active").siblings("span").removeClass("active");
                 size = $(this).html();
             });

             $("#detailInfo").on("tap", "#plus", function() {
                 let count = parseInt($("#num").val()) + 1;
                 $("#num").val(count);

             });

             $("#detailInfo").on("tap", "#minus", function() {
                 let count = parseInt($("#num").val()) - 1;
                 if (count <= 0) { count = 1 }
                 $("#num").val(count);

             });

         });

     function addCart() {
         $("#num").val();
         if (!size || size === "") {
             alert("请选择尺码！")
             return;
         }
         $.ajax({
             url: "/cart/addCart",
             type: "post",
             data: {
                 productId: id,
                 num: $("#num").val(),
                 size: size
             },
             success: function() {
                 mui.confirm("加入购物车成功，跳转到购物车",
                     function(msg) {
                         if (msg.index) {
                             location.href = "cart.html"
                         }

                     })
             }
         })
     }